import Vue from "vue";
import Axios from "axios";

// 进度条
import NProgress from "nprogress";
import "nprogress/nprogress.css";

// 基准路径
Axios.defaults.baseURL = "https://www.liulongbin.top:8888/api/private/v1/";

// 请求拦截器
Axios.interceptors.request.use((config) => {
  NProgress.start();
  config.headers.Authorization = sessionStorage.token;
  return config;
});
// 响应拦截器
Axios.interceptors.response.use((config) => {
  NProgress.done();
  return config;
});


Vue.prototype.axios = Axios;
